Page({
  data: {
    // 定义页面映射对象
    pageMap: {
        grid1: '/pages/chengkao/ck_exam_registrationInfo/ck_exam_registrationInfo',
        grid2: '/pages/chengkao/ck_info_pages/ck_vocational_school/ck_vocational_school',
        grid3: '/pages/chengkao/ck_info_pages/ck_graduation_type/ck_graduation_type',
        grid4: '/pages/chengkao/ck_info_pages/ck_occupation/ck_occupation',
        grid5: '/pages/chengkao/ck_info_pages/ck_exam_type/ck_exam_type',
        grid6: '/pages/chengkao/ck_info_pages/ck_education/ck_education',  
        grid7: '/pages/chengkao/ck_info_pages/ck_exam_site/ck_exam_site', 
        grid8: '/pages/chengkao/ck_info_pages/ck_feature/ck_feature', 
        grid9: '/pages/chengkao/ck_info_pages/ck_level/ck_level',  
        grid10: '/pages/chengkao/ck_info_pages/ck_subject/ck_subject',
        grid11: '/pages/chengkao/ck_info_pages/ck_study_location/ck_study_location',
        grid12: '/pages/chengkao/ck_info_pages/ck_category/ck_category'
    },
    bannerList: [
      { src: "/icon/huiyi2.jpg" },
      { src: "/icon/test2.jpg" },
      { src: "/icon/test3.jpg" }
    ],
  },

  // 跳转函数
  // 统一跳转函数，根据 data-type 获取跳转路径
  gotoPage(e) {
    const type = e.currentTarget.dataset.type;
    const url = this.data.pageMap[type];
    if (url) {
      wx.navigateTo({
        url: url,
        success: res => console.log('跳转成功:', url),
        fail: err => console.error('跳转失败:', err)
      });
    } else {
      console.error('未找到对应的页面路径，type:', type);
    }
},
});
